package com.linkallcloud.core.enums;

public enum FieldType implements EnumBase<String> {

    Text("text", "文本输入框"), TextArea("textarea", "多行文本框"), Select("select", "选择框"), Date("date", "日期选择"),
    Datetime("datetime", "日期时间选择"), File("file", "上传文件");

    private String code;
    private String message;

    FieldType(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public static FieldType get(String code) {
        for (FieldType ul : values()) {
            if (ul.getCode().equals(code)) {
                return ul;
            }
        }
        return null;
    }

}
